<template>
<div>
<Channels @change="get_channel_id"></Channels>  <!--此处是一个事件，从子组件中获取选中的ID-->
<Newslist :news="news"></Newslist>
</div>
  
</template>

<script>
import Channels from "./Channels"
import Newslist from "./NewsList"
import {getNews} from "@/service/newsService"
export default {
    components:{
        Channels,
        Newslist,
    },

data(){
    return {
        news:[]
    }
},

methods:{
    async get_channel_id(id){
        console.log("高高手第公爵阿尔破i感觉哦怕")
        console.log(id)
      var res= await getNews(id,1,10)
      console.log('444444444444')
      console.log(res)
      this.news=res
        
    },   
}

}
</script>

<style>

</style>